package service;

public class AirlineReservationServiceProxy implements service.AirlineReservationService {
  private String _endpoint = null;
  private service.AirlineReservationService airlineReservationService = null;
  
  public AirlineReservationServiceProxy() {
    _initAirlineReservationServiceProxy();
  }
  
  public AirlineReservationServiceProxy(String endpoint) {
    _endpoint = endpoint;
    _initAirlineReservationServiceProxy();
  }
  
  private void _initAirlineReservationServiceProxy() {
    try {
      airlineReservationService = (new service.AirlineReservationServiceServiceLocator()).getAirlineReservationService();
      if (airlineReservationService != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)airlineReservationService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)airlineReservationService)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (airlineReservationService != null)
      ((javax.xml.rpc.Stub)airlineReservationService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public service.AirlineReservationService getAirlineReservationService() {
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService;
  }
  
  public bean.Flight[] searchFlights(java.lang.String source, java.lang.String destination, java.lang.String startDate, java.lang.String returnDate, java.lang.String tripType, int numTravelers) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.searchFlights(source, destination, startDate, returnDate, tripType, numTravelers);
  }
  
  public bean.Flight[] viewFlights() throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.viewFlights();
  }
  
  public bean.Journey[] reserve(int numTickets, bean.Journey[] journey, long personId) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.reserve(numTickets, journey, personId);
  }
  
  public void cancelReservation(long confirmationNumber) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    airlineReservationService.cancelReservation(confirmationNumber);
  }
  
  public bean.Journey[] viewReservationsForFlight(int flightId) throws java.rmi.RemoteException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.viewReservationsForFlight(flightId);
  }
  
  public bean.Journey[] viewAllReservations() throws java.rmi.RemoteException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.viewAllReservations();
  }
  
  public bean.Journey[] viewReservationsForTraveller(long personId) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.viewReservationsForTraveller(personId);
  }
  
  public bean.Journey viewReservationDetails(long confirmationNumber) throws java.rmi.RemoteException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.viewReservationDetails(confirmationNumber);
  }
  
  public void createEmployee(java.lang.String firstName, java.lang.String lastName, java.lang.String userName, java.lang.String password, java.lang.String addressLine1, java.lang.String addressLine2, java.lang.String city, java.lang.String state, java.lang.String dateOfBirth, long id, java.lang.String type, java.lang.String workDescription, java.lang.String hireDate, java.lang.String position, java.lang.String role, long created_by, java.lang.String created_on, long updated_by, java.lang.String updated_on, long zip) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    airlineReservationService.createEmployee(firstName, lastName, userName, password, addressLine1, addressLine2, city, state, dateOfBirth, id, type, workDescription, hireDate, position, role, created_by, created_on, updated_by, updated_on, zip);
  }
  
  public void createCustomer(java.lang.String firstName, java.lang.String lastName, java.lang.String userName, java.lang.String password, java.lang.String addressLine1, java.lang.String addressLine2, java.lang.String city, java.lang.String state, java.lang.String dateOfBirth, long id, java.lang.String type, java.lang.String passportNumber, java.lang.String nationality, long zip) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    airlineReservationService.createCustomer(firstName, lastName, userName, password, addressLine1, addressLine2, city, state, dateOfBirth, id, type, passportNumber, nationality, zip);
  }
  
  public void editCustomer(java.lang.String firstName, java.lang.String lastName, java.lang.String userName, java.lang.String password, java.lang.String addressLine1, java.lang.String addressLine2, java.lang.String city, java.lang.String state, java.lang.String dateOfBirth, long id, java.lang.String passportNumber, java.lang.String nationality, long zip) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    airlineReservationService.editCustomer(firstName, lastName, userName, password, addressLine1, addressLine2, city, state, dateOfBirth, id, passportNumber, nationality, zip);
  }
  
  public void editEmployee(java.lang.String firstName, java.lang.String lastName, java.lang.String userName, java.lang.String password, java.lang.String addressLine1, java.lang.String addressLine2, java.lang.String city, java.lang.String state, java.lang.String dateOfBirth, long id, java.lang.String type, java.lang.String workDescription, java.lang.String hireDate, java.lang.String position, java.lang.String role, long created_by, java.lang.String created_on, long updated_by, java.lang.String updated_on, long zip) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    airlineReservationService.editEmployee(firstName, lastName, userName, password, addressLine1, addressLine2, city, state, dateOfBirth, id, type, workDescription, hireDate, position, role, created_by, created_on, updated_by, updated_on, zip);
  }
  
  public void deletePerson(long id) throws java.rmi.RemoteException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    airlineReservationService.deletePerson(id);
  }
  
  public void deleteEmployee(long id) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    airlineReservationService.deleteEmployee(id);
  }
  
  public void deleteCustomer(long id) throws java.rmi.RemoteException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    airlineReservationService.deleteCustomer(id);
  }
  
  public bean.Traveler[] listCustomers() throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.listCustomers();
  }
  
  public bean.Traveler[] viewTravelerByFlight(int flightId) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.viewTravelerByFlight(flightId);
  }
  
  public bean.Employee[] listEmployees() throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.listEmployees();
  }
  
  public bean.Journey issueTicket(long confirmationNumber) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.issueTicket(confirmationNumber);
  }
  
  public bean.Employee[] searchEmployees(java.lang.String firstName, java.lang.String lastName, long id, java.lang.String workDescription) throws java.rmi.RemoteException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.searchEmployees(firstName, lastName, id, workDescription);
  }
  
  public bean.Flight[] getFlightDetails(long[] flightIds) throws java.rmi.RemoteException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.getFlightDetails(flightIds);
  }
  
  public bean.Person authenticateUser(java.lang.String username, java.lang.String password) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.authenticateUser(username, password);
  }
  
  public boolean checkUser(java.lang.String username) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.checkUser(username);
  }
  
  public void deleteReservation(long confirmationNumber) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    airlineReservationService.deleteReservation(confirmationNumber);
  }
  
  public bean.Employee getEmployeeDetails(long id) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.getEmployeeDetails(id);
  }
  
  public bean.Traveler getTravelerDetails(long id) throws java.rmi.RemoteException, exception.DAOException{
    if (airlineReservationService == null)
      _initAirlineReservationServiceProxy();
    return airlineReservationService.getTravelerDetails(id);
  }
  
  
}